package com.xiaojie.learn.util.threadpool;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

public class BizThreadRejectedHandler implements RejectedExecutionHandler {
    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        if(r instanceof BizRunnable){
            final String bizMsg = ((BizRunnable) r).getBizMsg();
            System.out.println(bizMsg);
            //TODO
        }
    }
}
